JBoss Community Archive (Read Only)

RHQ 4.5

Web Service Client samples and examples

This page is a work in progress and the information found here is subject change.

The presence of a Web Service client example/excerpt for a platform/language does NOT mean that such a client is fully supported. The only clients officially supported for this release are JBossWS 3.1.1 clients at this time.

Web Service Client examples

The beauty of Web Services is that no limitations are set on the languages or platforms from which requests can be made, only that when those requests are made, that they be correctly serialized as SOAP documents as described by the WSDL document. To that end no attempt is made here to provide samples/examples for all available platforms but to document some of the steps taken to consume the RHQ wsdl from a few popular platforms.

Generating WSDL types

WSDL schema defines strongly typed language specific objects on consumption. This means that programmatic access to RHQ web services can be made using compiled types generated using your favorite WSDL consumption toolkit. For scripting language clients(e.g. PHP) there may be no such step type generation step as the interpreter will create the appropriate objects at runtime.

Correct setup of the platform/tool is assumed and no dns problems resolving machine where WSDL hosted.

Axis2(axis2-1.5 Windows XP)

(axis2-1.5 dir)\bin\wsdl2java.bat -o src -uri (insert dir of wsdl)\WebservicesManagerBean.wsdl

Apache CXF(apache-cxf-2.2.3)

(apache-cxf-2.2.3 dir)\bin\wsdl2java.bat -client -compile (insert dir of wsdl)\WebservicesManagerBean.wsdl

The generated types do not compile out of the box. Exception classes need to be modified in generated source files to extend java.lang.Exception instead.

Compile and consume accordingly.

GlassFish

gSoap(2.7 WSDL Parser 1.2.13 Win XP)

(gsoap-2.7 dir)\gsoap\bin\win32>wsdl2h.exe -o jopr.h (insert dir of wsdl)\WebservicesManagerBean.wsdl

(gsoap-2.7 dir)\gsoap\bin\win32>soapcpp2.exe -i -C -I(gsoap-2.7 dir)\gsoap\import jopr.h

Compile and consume accordingly.

JBossWS(3.1.1)

cd RHQ/jbossas/bin
./wsconsume.sh --package=org.jopr.ws \
               --output=/home/me/myjoprclient/src/main/java \
               --target=2.1 http://<Host>:<Port>/rhq-rhq-enterprise-server-ejb3/WebservicesManagerBean?wsdl

Compile and consume accordingly with wsrunclient.sh/bat or equivalent classpath.

PHP(5.2.10 Win XP)(via libxml2)

N/A as the scripting language will generate the require objects at runtime.

VB.NET(Visual Studio Web Developer 2008 Express Edition)

See adding a web reference for details of how to use. Add was successful which is a wsdl consume.

XmlBeans(2.4.0)

(xmlbeans-2.4.0 dir)\bin\scomp -mx 256m -src src (insert wsdl dir)\WebservicesManagerBean.wsdl
Compiled types to: xmltypes.jar

The default memory for compiler had to be incremented for compilation to succeed.

Compile and consume accordingly.

Client Code Excerpts

Correct setup of the platform/hosting environment is assumed and no dns problems resolving machine where WSDL hosted.

Axis2

TODO

Apache CXF

TODO

GlassFish

TODO

gSoap

TODO

PHP(via libxml2)

TODO

VB.NET

TODO

XmlBeans

TODO

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-12 13:19:53 UTC, last content change 2009-11-09 14:54:30 UTC.